<form action="./" method="post">
    <div class="wrapper">
        <label>Select actions</label>
        <select name="step" onChange="if($(this).val()=='initDatabase'){$('#useSimple').show();}else{$('#useSimple').hide();};if($(this).val()=='update'){$('#useUpdate').show();}else{$('#useUpdate').hide();}">
            <option value="initDatabase">Initialize the database(new installation)</option>
            <option value="update"<#if fromVersion?has_content> selected="true"</#if>>Upgrade database(older CMS upgrade)</option>
            <option value="start">Direct boot</option>
        </select>
    </div>
    <div id="useSimple"<#if fromVersion?has_content> style="display:none"</#if>>
        <#if usersql?has_content&&usersql>
            <div class="wrapper">
                <input type="checkbox" name="useSimple" checked="checked" value="true"/>Import sample data (publiccms.sql in the data catalog)
            </div>
        </#if>
        <div class="wrapper">
            <label>Administrator username</label><input type="text" maxlength="30" name="username" value="admin"/>
        </div>
        <div class="wrapper">
            <label>Administrator password</label><input type="text" maxlength="30" required="required" name="password" value=""/>
        </div>
        <div class="wrapper">
            <label>Site url</label><input type="text" maxlength="30" required="required" name="siteurl" value="${siteurl!}"/>
        </div>
    </div>
    <div class="wrapper" id="useUpdate"<#if !fromVersion?has_content> style="display:none"</#if>>
        <label>Original CMS version</label>
        <select name="from_version">
            <#list versions as v>
                <option value="${v}"<#if fromVersion?has_content&&fromVersion=v> selected="true"</#if>>${v}</option>
            </#list>
        </select>
    </div>
</form>